package com.jueling.culture.service.impl;

import com.jueling.culture.dto.res.AgentConfigSelectVO;
import com.jueling.culture.mapper.AgentConfigMapper;
import com.jueling.culture.model.AgentConfig;
import com.jueling.culture.service.AgentConfigService;
import com.jueling.culture.core.AbstractService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;


/**
 * @describe 代理配置
 * @author linp
 * @date  2022/04/11
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class AgentConfigServiceImpl extends AbstractService<AgentConfig> implements AgentConfigService {

    @Resource
    @SuppressWarnings("unused")
    private AgentConfigMapper dlpzMapper;


    /**
     * 删除代理配置
     *
     * @param id
     */
    @Override
    public void deleteAgentConfig(String id) {
        dlpzMapper.deleteAgentConfig(id);
    }

    /**
     * 获取代理配置最大ID
     *
     * @return
     */
    @Override
    public String getMaxDljbId() {
        return dlpzMapper.getMaxDljbId();
    }

    /**
     * 下拉使用
     *
     * @return
     */
    @Override
    public List<AgentConfigSelectVO> listSelect() {
        return dlpzMapper.listSelect();
    }

    /**
     * 判断代理别ID是否已存在
     *
     * @param dljbId
     * @return
     */
    @Override
    public boolean getDljbId(String dljbId) {
        return dlpzMapper.getDljbId(dljbId);
    }

    /**
     * 获取代理配置明细
     *
     * @param id
     * @return
     */
    @Override
    public AgentConfig getAgentConfig(String id) {
        return dlpzMapper.getAgentConfig(id);
    }
}
